"""
    携带浏览器信息
"""
import requests

url = 'https://www.baidu.com'

# 设置请求头参数
headers = {
    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36'
}

# 发起模拟请求，并设置请求头参数
response = requests.get(url, headers=headers)
print(response.request.headers)
# 手动设置编码规则
response.encoding = 'utf-8'

print(response.text)
